package com.debao;

import com.debao.common.core.domain.AjaxResult;
import com.debao.common.utils.SecurityUtils;
import com.debao.system.domain.UserCard;
import com.debao.system.service.IUserCardService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/api/userCard")
@RestController
@CrossOrigin
public class ApiUserCard {
    @Resource
    private IUserCardService userCardService;

    @GetMapping("/getUserCard")
    public AjaxResult userCard() {
        Long userId = SecurityUtils.getUserId();
        UserCard userCard = userCardService.selectUserCardByUserId(userId);
        return AjaxResult.success(userCard);
    }

}
